package com.lening.iot.aliyun.strategy;

import com.lening.common.web.Request;
import com.lening.iot.aliyun.vo.IotVO;
import com.lening.iot.po.IotsPO;
import com.lening.iot.vo.IotsVO;
import lombok.val;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;

/**
 * @ToDo:
 * @Author：李忠达
 * @date: 2024/6/23 23:53
 */
@Component
public class IotsStrategy implements IotStrategy{
    @Override
    public void iotAddStrategy(IotVO iot) {
        System.out.println("Iot");
        IotsPO iotPO=new IotsPO();
        iotPO.setDeviceType(iot.getDeviceType());
        iotPO.setIotId(iot.getIotId());
        iotPO.setRequestId(iot.getRequestId());
        iotPO.setProductKey(iot.getProductKey());
        iotPO.setGmtCreate(iot.getGmtCreate());
        iotPO.setDeviceName(iot.getDeviceName());
        String responseMono = Request.asyncPost("iot/Iots/add", iotPO, String.class);

//        System.out.println(responseMono.block() +"===================");
        System.out.println(iotPO+"==========="+iotPO.getDeviceType()+"12354566");
    }
}
